package com.yaoyou.dao;

import com.yaoyou.model.dataObject.ShopMedicine;
import com.yaoyou.model.dataObject.ShopMedicineExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ShopMedicineMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @SelectProvider(type=ShopMedicineSqlProvider.class, method="countByExample")
    int countByExample(ShopMedicineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @DeleteProvider(type=ShopMedicineSqlProvider.class, method="deleteByExample")
    int deleteByExample(ShopMedicineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Delete({
        "delete from SHOP_MEDICINE",
        "where SHOP_MEDICINE_ID = #{shopMedicineId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String shopMedicineId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Insert({
        "insert into SHOP_MEDICINE (SHOP_MEDICINE_ID, PRICE, ",
        "STORAGE_COUNT, SHOP_INFO_ID, ",
        "MEDICINE_ID, CREATE_USER_NAME, ",
        "CREATE_TIME, CREATE_USER_ID)",
        "values (#{shopMedicineId,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, ",
        "#{storageCount,jdbcType=INTEGER}, #{shopInfoId,jdbcType=VARCHAR}, ",
        "#{medicineId,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=VARCHAR})"
    })
    int insert(ShopMedicine record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @InsertProvider(type=ShopMedicineSqlProvider.class, method="insertSelective")
    int insertSelective(ShopMedicine record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @SelectProvider(type=ShopMedicineSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="SHOP_MEDICINE_ID", property="shopMedicineId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="PRICE", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="STORAGE_COUNT", property="storageCount", jdbcType=JdbcType.INTEGER),
        @Result(column="SHOP_INFO_ID", property="shopInfoId", jdbcType=JdbcType.VARCHAR),
        @Result(column="MEDICINE_ID", property="medicineId", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_USER_NAME", property="createUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_TIME", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATE_USER_ID", property="createUserId", jdbcType=JdbcType.VARCHAR)
    })
    List<ShopMedicine> selectByExample(ShopMedicineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Select({
        "select",
        "SHOP_MEDICINE_ID, PRICE, STORAGE_COUNT, SHOP_INFO_ID, MEDICINE_ID, CREATE_USER_NAME, ",
        "CREATE_TIME, CREATE_USER_ID",
        "from SHOP_MEDICINE",
        "where SHOP_MEDICINE_ID = #{shopMedicineId,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="SHOP_MEDICINE_ID", property="shopMedicineId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="PRICE", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="STORAGE_COUNT", property="storageCount", jdbcType=JdbcType.INTEGER),
        @Result(column="SHOP_INFO_ID", property="shopInfoId", jdbcType=JdbcType.VARCHAR),
        @Result(column="MEDICINE_ID", property="medicineId", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_USER_NAME", property="createUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_TIME", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATE_USER_ID", property="createUserId", jdbcType=JdbcType.VARCHAR)
    })
    ShopMedicine selectByPrimaryKey(String shopMedicineId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @UpdateProvider(type=ShopMedicineSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ShopMedicine record, @Param("example") ShopMedicineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @UpdateProvider(type=ShopMedicineSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ShopMedicine record, @Param("example") ShopMedicineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @UpdateProvider(type=ShopMedicineSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ShopMedicine record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_MEDICINE
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Update({
        "update SHOP_MEDICINE",
        "set PRICE = #{price,jdbcType=DECIMAL},",
          "STORAGE_COUNT = #{storageCount,jdbcType=INTEGER},",
          "SHOP_INFO_ID = #{shopInfoId,jdbcType=VARCHAR},",
          "MEDICINE_ID = #{medicineId,jdbcType=VARCHAR},",
          "CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},",
          "CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},",
          "CREATE_USER_ID = #{createUserId,jdbcType=VARCHAR}",
        "where SHOP_MEDICINE_ID = #{shopMedicineId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(ShopMedicine record);
}